Data storage devices, such as hard disk drives (HDDs), hybrid drives, and solid state drives (SSDs), may receive power from a host power supply, which can reside in a desktop or laptop computer or be a standalone power supply, for example. The host power supply typically receives its power from an AC power line. However, if voltage transients occur on the AC power line and the host power supply is not designed sufficiently well, the data storage device to which it is connected may be subjected to overvoltage spikes, which may cause errors, such as data write errors, or performance issues. For example, in an HDD, overvoltage spikes of sufficient amplitude might trigger shock sensors, thereby hurting read and write performance of the drive.
If data storage devices are subject to overvoltage spikes from external power supplies, it is desirable to detect and record the occurrence of the overvoltage spikes in the data storage device. This may allow a failure analysis engineer at a device manufacturer to determine if the recorded overvoltage spikes may be the cause of device failure if a customer's failed device is returned to the manufacturer.